<template>
  <div class="common-layout">
    <el-container>
      <!-- 左边 -->
      <el-aside width="200px" class="left">
        <el-row class="tac">
          <el-col :span="12">
            <el-menu
              default-active="/listView/home"
              class="el-menu-vertical-demo"
              background-color="#304156"
              router
            >
              <!-- 首页 -->
              <el-menu-item index="/listView/home">
                <el-icon>
                  <!-- <icon-menu /> -->
                </el-icon>
                <span class="iconfont icon-shouye"></span>
                <span class="first">首页</span>
              </el-menu-item>
              <!-- 访客管理 -->
              <el-sub-menu index="2">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-liebiao"></span>
                  <span class="first">访客管理</span>
                </template>
                <!-- <el-menu-item-gro> -->
                <el-menu-item index="/listView/visitor" class="colorer"
                  >访客管理</el-menu-item
                >
                <el-menu-item index="/listView/auditor" class="colorer"
                  >核销人管理</el-menu-item
                >
                <el-menu-item index="/listView/school" class="colorer"
                  >校园动态管理</el-menu-item
                >
                <el-menu-item index="/listView/journal" class="colorer"
                  >审核日志</el-menu-item
                >
                <el-menu-item index="/listView/cancel" class="colorer"
                  >核销日志</el-menu-item
                >
                <!-- </el-menu-item-gro> -->
              </el-sub-menu>
              <!--行程管理 -->
              <el-sub-menu index="3">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-move"></span>
                  <span class="first">行程管理</span>
                </template>
                <el-menu-item index="/listView/track" class="colorer"
                  >轨迹管理</el-menu-item
                >
                <el-menu-item index="/listView/point" class="colorer"
                  >点位管理</el-menu-item
                >
              </el-sub-menu>
              <!-- 权限设置 -->
              <el-sub-menu index="4">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-image-text"></span>
                  <span class="first">权限设置</span>
                </template>
                <el-menu-item index="/privilege" class="colorer"
                  >角色管理</el-menu-item
                >
                <el-menu-item index="/conservator" class="colorer"
                  >管理员管理</el-menu-item
                >
              </el-sub-menu>
              <!-- 设置 -->
              <el-sub-menu index="5">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-setting"></span>
                  <span class="first">设置</span>
                </template>
                <el-menu-item index="/settings/settings" class="colorer"
                  >系统设置</el-menu-item
                >
                <el-menu-item index="/charts/keyboard" class="colorer"
                  >部门管理</el-menu-item
                >
              </el-sub-menu>
            </el-menu>
          </el-col>
        </el-row>
        <!-- ////// -->
      </el-aside>

      <el-container>
        <!-- 头部 -->
        <el-header class="head main">
          <!-- 面包屑 -->
          <div class="headertop">
            <HeaderView></HeaderView>
            <div class="admin">
              <el-icon class="qwe"><FullScreen @click="tooggleFullscreen()"/></el-icon> <!--全屏-->

                <el-dropdown trigger="click" class="jfhh">
                  <span class="el-dropdown-link">{{ name.name1.admin_name }}<el-icon class="el-icon--right"><arrow-down /></el-icon>
                  </span>
                  <template #dropdown>
                    <el-dropdown-menu>
                      <el-dropdown-item>个人资料修改</el-dropdown-item>
                      <el-dropdown-item @click="Logout">退出登录</el-dropdown-item>
                    </el-dropdown-menu>
                  </template>
                </el-dropdown>
            </div>
          </div>
        </el-header>
        
          <!-- 路由导航 -->
          <div style="padding:0 20px;" class="main">
              <TagList></TagList>
          </div>

        <el-main class="main">
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script lang="ts" setup>
import { ref, reactive } from "vue";
import screenfull from 'screenfull'
import HeaderView from "../components/header/HeaderView.vue"; //头部
import TagList from '../components/tagview.vue'//路由导航

let name1: any = ref(null);
let name: any = reactive({
  name1: JSON.parse(localStorage.getItem("userInfo") as any), //断言 as
});
// 全屏
const tooggleFullscreen=()=>{
  if(screenfull.isEnabled){
    screenfull.toggle()
  }
}

// 退出登录
let Logout =() =>{
  localStorage.setItem('token','')
  window.location.reload()
}


</script>
<style scoped lang="less">
.left {
  width: 200px;
  height: 100vh;
  overflow: hidden;
  background-color: #304156;
  position: fixed;
  z-index: 1000;
}
.main{
  margin-left: 200px;
}
.el-menu-item is-active {
  width: 200px;
  background-color: #304156;
}
.el-row {
  width: 400px;
  background-color: #304156;
  text-align: center;
}
.el-menu-item {
  padding: 0 !important;
}
/deep/.el-sub-menu__title {
  padding: 0 !important;
}
.first {
  margin-left: 10px;
  color: white;
}
.colorer {
  padding-left: 50px !important;
  color: rgb(191, 203, 217);
  background-color: #1f2d3d;
}
//鼠标滑过
.colorer:hover {
  background-color: #17222e;
}
.iconfont {
  color: rgb(191, 203, 217);
}
/deep/.el-icon {
  color: rgb(191, 203, 217) !important;
}
// 点击变色
.is-active {
  color: rgb(64 158 255);
}
.el-sub-menu .el-sub-menu__icon-arrow {
  color: rgb(191, 203, 217);
}
.headertop {
  width: 100%;
  height: 50px;
  /* background-color: aquamarine; */
  border-bottom: 1px solid rgba(0, 21, 41, 0.08);
  display: flex;

  align-items: center;
}
.head {
  display: flex;
  justify-content: space-between;
}
.admin {
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  position: absolute;
  right: 25px;
  margin-right: 10px;
}
.bigFont {
  margin-left: 5%;
}
.qwe{
  font-size: 28px;
  margin-right: 20px;
}
.el-icon svg {
    height: 1em;
    width: 1em;
    color: #000;
}
.jfhh{
  margin-top:5px;
}
</style>
